package xyz.tanxiao.links.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import xyz.tanxiao.links.config.GlobalProperties;

/**
 * 视图页面控制器
 *
 * @author 万成波
 * @email 2300064869@qq.com
 * @createTime 2023-06-15 20:11:09 星期四
 */
@RequiredArgsConstructor
@Controller
public class ViewController {

	private final GlobalProperties globalProperties;


	/**
	 * 首页视图页面
	 */
	@RequestMapping
	public String index(Model model) {
		model.addAttribute("indexExampleLink", this.globalProperties.getIndexExampleLink());
		return "index";
	}


	/**
	 * 密码访问视图页面
	 */
	@RequestMapping("/password")
	public String auth() {
		return "password";
	}


	/**
	 * 访问错误视图页面
	 */
	@RequestMapping("/fail")
	public String fail() {
		return "fail";
	}

}
